From: Jasper St. Pierre Date: Thu, 14 Feb 2013 21:48:28 +0000 (-0500) Subject: popupMenu: Treat a menu will all invisible menu items as empty X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4873 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=30179bb60d9788faa04a2fb9703f15429da9727d;p=gnome-shell.git popupMenu: Treat a menu will all invisible menu items as empty As an example, a menu that has only settings actions might be "empty" if allowSettings is false. https://bugzilla.gnome.org/show_bug.cgi?id=681540 --- diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 9807b6275..5123696f3 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -914,7 +914,11 @@ const PopupMenuBase = new Lang.Class({ }, isEmpty: function() { - return this.box.get_n_children() == 0; + let hasVisibleChildren = this.box.get_children().some(function(child) { + return child.visible; + }); + + return !hasVisibleChildren; }, isChildMenu: function(menu) {